#ifndef __KNNCLASSIFIER_H__
#define __KNNCLASSIFIER_H__

#include "Classifier.h"

#include <vector>
/*
// the pair struct as used by 
template <class T1, class T2> struct pair
{
  typedef T1 first_type;
  typedef T2 second_type;

  T1 first;
  T2 second;
  pair() : first(T1()), second(T2()) {}
  pair(const T1& x, const T2& y) : first(x), second(y) {}
  template <class U, class V>
    pair (const pair<U,V> &p) : first(p.first), second(p.second) { }
};
*/

class kNNClassifier : public Classifier
{
public:
  // Constructor, sets k to 1 as default
  kNNClassifier(const int& k = 1);
  virtual ~kNNClassifier();

  int getK() const;
  void setK(const int& k);

  virtual int test(const Sample& s) const;
  virtual void train(const DataSet& ds);
  
protected:
  int k_; // Number of neighbors to inspect
  std::vector<Sample> in_; // Samples
  std::vector<int> labels_; // Labels
};

#endif